package com.axjy.service.impl;

import com.axjy.mapper.RoleMapper;
import com.axjy.pojo.Role;
import com.axjy.service.RoleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class RoleServicelmpl implements RoleService {

    @Resource
    private RoleMapper roleMapper;

    @Override
    @Transactional(readOnly = true)
    public List<Role> list() {
       return roleMapper.findAll();
    }

    @Override
    public void update(Role role) {
        roleMapper.update(role);
    }

    @Override
    public void add(Role role) {
        roleMapper.add(role);
    }

    @Override
    public void del(Integer id) {
        roleMapper.del(id);
    }

    @Override
    public void bathDel(Integer[] ids) {
        roleMapper.batchDel(ids);
    }
}
